package com.wugui.datax.job.handler;

import com.wugui.datatx.core.biz.model.ReturnT;
import com.wugui.datatx.core.biz.model.TriggerParam;
import com.wugui.datatx.core.handler.IJobHandler;
import com.wugui.datatx.core.handler.annotation.JobHandler;
import com.wugui.datax.job.entity.HiveDemo;
import com.wugui.datax.job.service.HiveDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author luofei
 */
@JobHandler(value = "demoJobHandler")
@Component
public class DemoJobHandler extends IJobHandler {

	@Autowired
     private HiveDemoService hiveDemoService;
	@Override
	public ReturnT<String> execute(TriggerParam tgParam) throws Exception {
		List<HiveDemo> dataList = hiveDemoService.query();
		for(HiveDemo data:dataList){
			System.out.println("==========="+data.getName());
		}
		return ReturnT.SUCCESS;
	}
}
